<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>登录</title>
    <script src="js/jquery.min.js"></script>
    <script src="js/jquery.cookie.js"></script>
</head>
<body>
<div>
    <input type="text" id="username" placeholder="请输入用户名">
    <input type="password" id="password" placeholder="请输入密码">
    <input type="button" id="loginBtn" value="登录">
</div>

<script>
    $("#loginBtn").click(function () {
       let _csrf = $.cookie("XSRF-TOKEN");
       $.post('/login.html',{username:$("#username").val(),password:$("#password").val(),_csrf:_csrf},function (data) {
           alert(data);
       })
    })
</script>
</body>
</html>